/*
 * NetworkRequest.hpp
 *
 *  Created on: Nov 28, 2014
 *      Author: toti
 */

#ifndef NETWORKREQUEST_HPP_
#define NETWORKREQUEST_HPP_

#include <string>
#include <iostream>

class LocalClient;

class NetworkRequest {

public:

	enum NetworkRequestType {
		NICK_REQUEST, CHANNEL_CREATE_REQUEST, CHANNEL_REMOVE_REQUEST
	};

	enum NetworkRequestState {
		UNDECIDED, ACCEPTED, REJECTED
	};

private:

	NetworkRequestType networkRequestType;
	NetworkRequestState networkRequestState;

	LocalClient *localClient;

	std::string requestId;
	std::string sender;
	int voters;


	int positiveResponses;
	int negativeResponses;

public:

	NetworkRequest(NetworkRequestType networkRequestType);

	void addResponse(int response);
	void addResponse(std::string& response);

	void setLocalClient(LocalClient *localClient);
	void setRequestId(std::string& requestId);
	void setSender(std::string& sender);
	void setVoters(int voters);

	LocalClient				*getLocalClient();
	NetworkRequestState 	getRequestState();
	NetworkRequestType 		getNetworkRequestType();
	std::string& 			getRequestId();
	std::string& 			getSender();
	int 					getVoters();

};

#endif /* NETWORKREQUEST_HPP_ */
